#include <stdio.h>
#include <arpa/inet.h>

int main(){
    int a = 0x12345678;
    short b = 0x1234;

    printf("0x%8x, 0x%8x\n", a, htonl(a));
    printf("0x%4x, 0x%4x\n", b, htons(b));

}